# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $

MY_P="${P/'-1.9_alpha'/_1.9a}"
DESCRIPTION="The worlds first OpenSource Realtime Editing and Effects System."
HOMEPAGE="http://www.jahshaka.com"
SRC_URI="mirror://sourceforge/${PN}fx/${MY_P}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"

IUSE=""

DEPEND="virtual/x11
	>=media-libs/glut-3.7.1
	>=media-libs/freetype-2.1.4
	>=x11-libs/qt-3"

RDEPEND=${DEPEND}

S="${WORKDIR}/${PN}"

src_unpack() {
	unpack ${A}
	cd ${S}
	epatch ${FILESDIR}/ftgl.h.patch || die
}



src_compile() {
	./configure || die "configure failed"
	make || die
}

src_install() {

	# They do no harm but we don't like 'CVS' dirs in every subdir
	for i in $(ls -la -R * | grep CVS | grep / | cut -f1 -d:)
	do
	    einfo "Removing "${i}
	    rm -rf ${i}
	done

	local dirs="Pixmaps database fonts media scenes"
	dodir /opt/${PN}
	for i in $dirs ; do
	    cp -a $i ${D}/opt/${PN}/
	done

	cp -a jahshaka ${D}/opt/${PN}/

	echo "cd "/opt/${PN}/ > ${S}/jahshaka.sh
	echo "./"${PN} >> ${S}/jahshaka.sh
	exeinto ${D}/usr/bin
	newexe ${S}/jahshaka.sh jahshaka

	dodoc COPYRIGHT README AUTHORS TODO

}

